﻿using System;
using System.Collections.Generic;
using Jay.Sc2.Bof.Lib.State;
using Jay.Sc2.Bof.Lib.Tools;

namespace Jay.Sc2.Bof.Lib.Action
{
	public interface IAction : IComparable<IAction>
	{
		/// <summary>Execute the action on the current build order, changing it's state.</summary>
		/// <param name="bo">The build order executing the action.</param>
		void Execute(IBuildOrder bo);
		/// <summary>Return true if the current state of the build order can execute the action.</summary>
		/// <param name="bo">The build order executing the action.</param>
		bool CanExecute(IBuildOrder bo);
		/// <summary>Return true if the current state of the build order will never be able execute the action.</summary>
		/// <param name="bo">The build order executing the action.</param>
		bool IsInvalid(IBuildOrder bo);
		/// <summary>Return true if the action is useless to reach the goals.</summary>
		/// <param name="goals">The goals you want to reach.</param>
		bool IsUseless(IBuildOrder bo, IGoal goals);
		/// <summary>Return an array of all the actions that are needed to be executed before this action (null if no actions).</summary>
		//IAction[] Requirements { get; }
		/// <summary>Return an array of all the possible array of all the actions that are needed to be executed before this action (null if no actions).</summary>
		IAction[,] Requirements { get; }
		/// <summary>Return an array of all the possible array of all the actions that are needed to be executed before this action because this action need to use the results of the actions as product for input (null if no actions).</summary>
		IAction[,] Inputs { get; }
		Range InputRangeOf(IAction action);
		/// <summary>Return a list of all the actions (recursively) that are needed to be executed before this action (null if no actions).</summary>
		IList<IAction> AllRequirements { get; }
		/// <summary>Get the name of the action.</summary>
		string Name { get; }
		string CleanName { get; }
	}
}
